package main


import (
"fmt"
. "sync"
"time"
)

func start(){
  m.Lock()
  fmt.Println("start")
 // c.Wait()
  fmt.Println("end")
  time.Sleep(time.Second*2)
  m.Unlock()
}

var m Mutex
var c = NewCond(&m)
   
func main(){

   	m.Lock()
	c.Broadcast()
	m.Unlock()

   n := 2
   for i:=0 ;i< n;i++{

     go start()
   }

	m.Lock()
    time.Sleep(time.Second*1)
    fmt.Println("main")

	m.Unlock()

   time.Sleep(time.Second*10)
   fmt.Println("ok")
}



